﻿using strange.extensions.mediation.impl;

namespace CounterApp.StrangeIOC
{
    public class BtnSubViewMediator : EventMediator
    {
        [Inject]
        public BtnSubView View { get; set; }
        
        public override void OnRegister()
        {
            View.Init();
            
            View.dispatcher.AddListener("CLICK_EVENT",OnBtnSubClick);
        }

        void OnBtnSubClick()
        {
            dispatcher.Dispatch(DecreaseCommand.EVENT);
        }

        public override void OnRemove()
        {
            View.dispatcher.RemoveListener("CLICK_EVENT",OnBtnSubClick);

        }
    }
}